package multithread.framework.threadmethod;

import java.lang.annotation.Annotation;
import java.util.concurrent.CompletionService;
import java.util.concurrent.ExecutorService;
/**
 * package for test method and run in multithreading info
 * @see ThreadMethod 
 * @see ThreadMethodGroup
 * @author dailey_dai
 *
 */
public interface IThreadMethod {

	/**
	 * Use ExecutorService to execute test case
	 * @param service ExecutorService		
	 * @param instance test case		
	 * @param annotationClzs	
	 * @return
	 */
	FutureQueue<ThreadResult> invoke(ExecutorService service,
			final Object instance,
			Class<? extends Annotation>... annotationClzs);

	/**
	 * use CompletionService to execute test case
	 * @param service CompletionService
	 * @param instance test case
	 * @param annotationClzs
	 * @return
	 */
	FutureQueue<ThreadResult> invoke(CompletionService<ThreadResult> service,
			final Object instance,
			Class<? extends Annotation>... annotationClzs);

	int getThreadCount();

}
